home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 7887 < prev    next >
Encoding:
Text File  |  1996-08-05  |  806 b   |  44 lines

  1. Newsgroups: comp.lang.c++
  2. Path: slam.ldgo.columbia.edu!okeefe
  3. From: okeefe@slam.ldgo.columbia.edu (paul okeefe)
  4. Subject: filter to add 'extern "C"' to .h files
  5. Message-ID: <1996Feb16.163806.10605@lamont.ldgo.columbia.edu>
  6. Sender: news@lamont.ldgo.columbia.edu (USENET News System)
  7. Organization: Lamont-Doherty Earth Observatory
  8. Date: Fri, 16 Feb 1996 16:38:06 GMT
  9.  
  10. Can someone point me to a PERL script to add the C linkage
  11. specification to a C header file?
  12.  
  13. Paul O'Keefe
  14.  
  15. ==================================
  16.  
  17. BEFORE:
  18.  
  19. #ifndef _MATH_H
  20. #define _MATH_H
  21.  
  22. double sqrt(double);
  23.  
  24. #endif  /* !defined(_MATH_H) */
  25.  
  26. ==================================
  27.  
  28. AFTER:
  29.  
  30. #ifndef _MATH_H
  31. #define _MATH_H
  32.  
  33. #ifdef __cplusplus
  34. extern "C" {
  35. #endif
  36.  
  37. double sqrt(double);
  38.  
  39. #ifdef __cplusplus
  40. }
  41. #endif
  42.  
  43. #endif  /* !defined(_MATH_H) */
  44.